/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    touch-action: none;
    background-color: #f8f8f8;
    font-family: "Microsoft YaHei", sans-serif;
}

#app {
    width: 100%;
    height: 100%;
    position: fixed;
    overflow: hidden;
    touch-action: none;
}

/* 欢迎页样式 */
.welcome-page {
    width: 100%;
    height: 100%;
    background-color: #FF4D4F;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.welcome-content {
    background-image: url('image/welcome_background.jpeg');
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.start-button {
    padding: 20px 40px;
    font-size: 24px;
    color: #D4380D;
    background: linear-gradient(to bottom, #FFD700, #FFA500);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    will-change: transform;
}

.start-button:hover {
    transform: scale(1.05);
}

/* 游戏页样式 */
.game-page {
    width: 100%;
    height: 100%;
    position: relative;
    display: none;
}

.game-header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 15px;
    color: #D4380D;
    display: flex;
    gap: 20px;
}

.game-container {
    position: fixed;
    width: 100%;
    height: 100%;
    background-image: url('image/game_background.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    -webkit-overflow-scrolling: touch;
    touch-action: none;
}

canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: transparent;
    overflow: hidden;
}

.player-container {
    position: absolute;
    width: 100%;
    height: 150px;
    bottom: 0;
    left: 0;
    z-index: 2;
    overflow: visible;
    pointer-events: none;
}

.player {
    position: absolute;
    width: 150px;
    height: 150px;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    transition: left 0.1s linear;
    pointer-events: none;
    will-change: transform, left;
}

/* 结算弹窗样式 */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    padding: 50px;
    border-radius: 30px;
    text-align: center;
}

.final-score {
    font-size: 120px;
    background: linear-gradient(to right, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 20px 0;
}

/* 加载进度条样式 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.progress-bar {
    width: 80%;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, #FFD700, #FFA500);
    transition: width 0.3s;
}

@media (max-width: 768px) {
    .player {
        width: 120px;
        height: 120px;
        bottom: 15px;
    }
}

@media (max-width: 600px) {
    .game-header {
        height: 40px;
        padding: 0 10px;
    }

    .luck-value, .timer {
        font-size: 20px;
    }

    .player {
        width: 100px;
        height: 169px;
    }

    #start-button {
        top: 60%;
        padding: 8px 16px;
        font-size: 20px;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .game-header {
        height: 45px;
        padding: 0 15px;
    }

    .luck-value, .timer {
        font-size: 22px;
    }

    .player {
        width: 110px;
        height: 183px;
    }

    #start-button {
        top: 63%;
        padding: 10px 20px;
        font-size: 22px;
    }
}